function grab_route_info_status()
{
// get the automatic routes from rdata
byte_array = convertFromBase64 (rdata);
i = 0;
num_entries = sU(2);
sU(1);
route = new Array();
for (var j=0; j 0) ? dhcp_ip_to_mac[ip] : '';
}
function dhcpIPToHostname(ip)
{
return (num_leases > 0) ? dhcp_ip_to_hostname[ip] : '';
}
function computeDHCPLeasePulldown()
{
document.mainform.dhcp_leases.options[0] = new Option ("Select Machine", "-1");
for (var j=0; j';
}
/*
* GetIEVersion
* Get the major version of IE. Return -1 if it is not IE
*/
function GetIEVersion()
{
var agt=navigator.userAgent.toLowerCase();
var ie_ix = agt.indexOf("msie");
if (ie_ix != -1) {
return (agt.charAt(ie_ix + 5) - '0');
}
return -1;
}
/*
* IsActiveXReady
* Is the ActiveX is ready to be used
*/
function IsActiveXReady(ax)
{
return ax.ReadyState == 4;
}
function DebugAlert(msg)
{
if (window && window.event && window.event.ctrlKey) {
alert(msg);
}
}
/*
* IsWCNSupported
* WCN is only supported on Windows XP/SP2 or later platforms, parse the userAgent string as much as possible to
* determin the os platform.
*
* check http://forums.devarticles.com/archive/t-1031/UserAgent for the list of userAgent formats
* on different browsers/versions.
*/
function IsWCNSupported()
{
var agt = navigator.userAgent.toLowerCase();
// msie 5.0 shows 'windows xp' instead of 'windows nt 5.1' and no sp version.
// the activex has to take care of the sp version check in this case
if (agt.indexOf("windows xp") != -1) {
return true;
}
// otherwise, the xp name string has to be 'windows nt 5.1;'
var os_ix = agt.indexOf("windows nt ");
if (os_ix == -1) {
return false;
}
var major = agt.charAt(os_ix + 11);
var minor = agt.charAt(os_ix + 13);
// it's XP or newer version os
if (major >= '5' && minor > '1') {
return true;
}
// only MSIE 6.0 or later gives Service Pack version in userAgent string.
// again, the activex has to take care of the sp version check in this case
if (GetIEVersion >= 6) {
// check SP version, SP2 should be shown as sv1
var sp_ix = agt.indexOf("sv");
if (sp_ix <= os_ix) {
return false;
}
var sp_v = agt.charAt(sp_ix + 2);
if (sp_v < '1') {
return false;
}
}
return true;
}
/*
* IsActiveXSupported
* Whether the browser supports ActiveX
*
* To make things simpler, only IE4.0 or later is supported here
*/
function IsActiveXSupported()
{
return (GetIEVersion() >= 4);
/*
Microsoft IE 4.0 or later supports ActiveX. Most of other browsers, like Netscape and Firefox,
may have plugins to support ActiveX. However, very often Active is only enabled for a few controls
and it needs the user to add the clsid to the allowed list, too complex for WCN.
var pi = navigator.plugins;
for (var i=0; i< pi.length; i++) {
if (pi[i].name.toLowerCase().indexOf("activex") != -1) {
return true;
}
}
return false;
*/
}
/*
* LoadWCNObject
* Common procedure to dynamically load the ActiveX control and verify the state of the control
*/
function LoadWCNObject(wcn_id, classid, codebase)
{
// http://www.metalusions.com/backstage/articles/8/, for older versions of IE
if(document.all && !document.getElementById) {
document.getElementById = function(id) {
return document.all[id];
}
}
var wcn_obj = document.getElementById(wcn_id);
if (!wcn_obj) {
LoadActiveX(wcn_id, classid, codebase);
wcn_obj = document.getElementById(wcn_id);
if (!IsActiveXReady(wcn_obj)) {
alert('Please accept and install the ActiveX, then try it again.');
return false;
}
} else {
if (!IsActiveXReady(wcn_obj)) {
alert('WCN ActiveX control is not available. Please check the security setting and refresh this page to install it.');
return false;
}
}
return true;
}
/*
* WCNValidateWSettings
* Check if the current wireless settings are supported by WCN
*/
function WCNValidateWSettings()
{
if (data.wireless.wepon && data.wireless.use_key != 0) {
alert('WCN does not support key index other than 1 now.');
return false;
}
if (data.wireless.wpa_enabled) {
if (data.wireless.wpa_mode >= 2) {
alert('WCN does not support WPA2 mode now.');
return false;
}
if (data.wireless.ieee8021x_enabled) {
alert('WCN does not support WPA enterprise authentication now.');
return false;
}
}
// TODO: add more validation here
return true;
}
function calcDayList(x)
{
var days = new Array ("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
if (x==127) return "Every Day ";
s = "";
for (var i=0; i<7; i++) if (x&(1<